
import { queryByType } from '@/api/dictData'

const getDefaultState = () => {
  return {
  }
}

const state = getDefaultState()

const mutations = {
}

const actions = {
  /**
   * 通过类型获取字典数据
   * @param {*} dictType 字典类型
   */
  getByType({ commit }, dictType) {
    return new Promise(function (resolve, reject) {
      queryByType(dictType).then(res => {
        resolve(res)
      }).catch(err => {
        reject(err)
      })
    })
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
